//package com.fangngng.pushall.controller;
//
//import com.fangngng.pushall.dto.Result;
//import com.fangngng.pushall.dto.SearchTopicVO;
//import com.fangngng.pushall.service.SearchTopicService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Controller;
//import org.springframework.ui.Model;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.ResponseBody;
//
//import javax.websocket.server.PathParam;
//
///**
// * @author fei.fang
// * @date 2020/10/6
// **/
//@Controller
//@RequestMapping("/search")
//public class SearchController{
//
//    @Autowired
//    private SearchTopicService searchTopicService;
//
//    @GetMapping("/findAll")
//    @ResponseBody
//    public Result<Iterable<SearchTopicVO>> findAll(){
//        return Result.ok(searchTopicService.findAll());
//    }
//
//    @PostMapping("/save")
//    @ResponseBody
//    public Result<String> SearchTopicVO(@RequestBody SearchTopicVO vo){
//        searchTopicService.save(vo);
//        return Result.ok();
//    }
//
//    @GetMapping("/findByName")
//    @ResponseBody
//    public Result<Iterable<SearchTopicVO>> findByName(@PathParam("name") String name){
//        return Result.ok(searchTopicService.findByTopicName(name));
//    }
//
//    @GetMapping("/findByCode")
//    @ResponseBody
//    public Result<Iterable<SearchTopicVO>> findByCode(@PathParam("code") String code){
//        return Result.ok(searchTopicService.findByTopicCode(code));
//    }
//
//    @GetMapping("/findByNameOrCode")
//    public String findByNameOrCode(@PathParam("text") String text, Model model){
//        Iterable<SearchTopicVO> result = searchTopicService.findByTopicNameOrTopicCode(text);
//        model.addAttribute("result",result);
//        return "search";
//    }
//
//    @GetMapping("/topic")
//    public String search(@PathParam("text") String text, Model model){
//        Iterable<SearchTopicVO> result = searchTopicService.findByTopicName(text);
//        model.addAttribute("result",result);
//        return "search";
//    }
//
//
//}
